package cn.johnyu.base.controller;

import cn.johnyu.base.dao.AuthorMapper;
import cn.johnyu.base.model.Author;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AuthorController {
    @Autowired
    private AuthorMapper authorMapper;
    @GetMapping("/api/authors")
    public List<Author> findAllAuthors(){
        return authorMapper.findAllAuthors();
    }
}
